package pw.yumc.Residence.commandsub;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import cn.citycraft.PluginHelper.commands.BaseCommand;
import pw.yumc.Residence.ResidenceMain;
import pw.yumc.Residence.manager.ConfigManager;
import pw.yumc.Residence.text.Language;

public class CommandTool extends BaseCommand {
    ResidenceMain plugin;

    public CommandTool(final ResidenceMain plugin) {
        super("tool");
        this.plugin = plugin;
        setOnlyPlayerExecutable();
    }

    @SuppressWarnings("deprecation")
    @Override
    public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
        final Player player = (Player) sender;
        final Language language = plugin.getLanguage();
        final ConfigManager cmanager = plugin.getConfigManager();
        player.sendMessage(ChatColor.YELLOW + language.getPhrase("SelectionTool") + ":" + ChatColor.GREEN + Material.getMaterial(cmanager.getSelectionTooldID()));
        player.sendMessage(ChatColor.YELLOW + language.getPhrase("InfoTool") + ": " + ChatColor.GREEN + Material.getMaterial(cmanager.getInfoToolID()));

    }

}
